#include "TestCheckValidateCard.h"
#include "Card.h"
#include "CardBussiness.h"
#include "DatabaseAccess.h"

CPPUNIT_TEST_SUITE_REGISTRATION(TestCheckValidateCard);

TestCheckValidateCard::TestCheckValidateCard(void)
{
}

TestCheckValidateCard::~TestCheckValidateCard(void)
{
}

void TestCheckValidateCard::TestCheckValidateCard_InputNULL_ReturnFalse()
{
	char g_sCardIDInput[] = "";
	CCardBussiness objDao;		
	bool bActualResult = objDao.CheckValidateCard(g_sCardIDInput , NULL);
	bool bExpectedResult = false;
	CPPUNIT_ASSERT(bActualResult == bExpectedResult);
}

void TestCheckValidateCard::TestCheckValidateCard_InputLengthCardInvalid_ReturnFalse()
{
	char g_sCardIDInput[] = "123456789";
	CCardBussiness objDao;		
	bool bActualResult = objDao.CheckValidateCard(g_sCardIDInput , NULL);
	bool bExpectedResult = false;
	CPPUNIT_ASSERT(bActualResult == bExpectedResult);
}

void TestCheckValidateCard::TestCheckValidateCard_InputCardInvalid_ReturnFalse()
{
	char g_sCardIDInput[] = "1234567899876543";
	CCardBussiness objDao;
	bool bActualResult = objDao.CheckValidateCard(g_sCardIDInput , NULL);
	bool bExpectedResult = false;
	CPPUNIT_ASSERT(bActualResult == bExpectedResult);
}

void TestCheckValidateCard::TestCheckValidateCard_InputCard_Lock_Forever_ReturnFalse()
{
	char g_sCardIDInput[] = "1234567890098765";
	CCardBussiness objDao;
	bool bActualResult = objDao.CheckValidateCard(g_sCardIDInput , NULL);
	bool bExpectedResult = false;
	CPPUNIT_ASSERT(bActualResult == bExpectedResult);
}

void TestCheckValidateCard::TestCheckValidateCard_InputCard_Lock_TMP_ReturnFalse()
{
	char g_sCardIDInput[] = "1234567890215468";
	CCardBussiness objDao;
	bool bActualResult = objDao.CheckValidateCard(g_sCardIDInput , NULL);
	bool bExpectedResult = false;
	CPPUNIT_ASSERT(bActualResult == bExpectedResult);
}

void TestCheckValidateCard::TestCheckValidateCard_InputValid_ReturnTrue()
{
	char g_sCardIDInput[] = "1234567890123456";
	CCardBussiness objDao;
	bool bActualResult = objDao.CheckValidateCard(g_sCardIDInput , NULL);
	bool bExpectedResult = true;
	CPPUNIT_ASSERT(bActualResult == bExpectedResult);
}